package com.pan.admin.quartz.task;

import com.pan.admin.module.api.service.ApiLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 *  API日志任务调度
 *  TODO 只保留三天内的失败日志，其他删除，并保留成功日志
 *
 *  @author Pan
 */
@Component("apiLogTask")
public class ApiLogTask {

    @Autowired
    private ApiLogService apiLogService;

    /**
     * 清理API日志
     */
    public void cleanTask() {
        this.apiLogService.clean();
    }

    /**
     * 清理API日志(并发失败)
     */
    public void cleanApiLogDiscardTask() {
        this.apiLogService.cleanApiLogDiscard();
    }

}
